<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<body>

<form id="permissionform" class="form">
    <input type="hidden" name="id" th:value="${permission?.id}"/>
    <div class="form-line">
        <label for="parent">
            父资源
        </label>
        <select id="parent" name="parent" type="text" class="easyui-combotree" th:value="${permission?.parent?.id}" ></select>
    </div>
    <div class="form-line required">
        <label for="name">
            资源名称
        </label>
        <input id="name" name="name" type="text"  th:value="${permission?.name}" class="easyui-textbox" data-options="required:true"/>
    </div>
    <div class="form-line required">
        <label for="permissionKey">
            资源标识
        </label>
        <input id="permissionKey" name="permissionKey" type="text" th:value="${permission?.permissionKey}" class="easyui-textbox" data-options="required:true"/>
    </div>
    <div class="form-line">
        <label for="type">
            资源类型
        </label>
        <select id="type" name="type" class="easyui-combobox" data-options="editable:false,panelHeight:'auto'">
            <option value="MENU">菜单</option>
            <option value="FUNCTION">功能</option>
            <option value="BLOCK">区域</option>
        </select>
    </div>
    <div class="form-line">
        <label for="path">
            菜单路径
        </label>
        <input id="path" name="path" type="text" class="easyui-textbox" th:value="${permission?.path}" data-options="multiline:true"/>
    </div>
    <div class="form-line">
        <label for="resource">
            资源
        </label>
        <input id="resource" name="resource" type="text" class="easyui-textbox"  th:value="${permission?.resource}" data-options="multiline:true"/>
    </div>
    <div class="form-line">
        <label for="description">
            描述
        </label>
        <input id="description" name="description" type="text" class="easyui-textbox" th:value="${permission?.description}" data-options="multiline:true"/>
    </div>
    <div class="form-line">
        <label for="weight">
            权重
        </label>
        <input id="weight" name="weight" type="text" th:value="${permission?.weight}" class="easyui-textbox"/>
    </div>
    <div class="form-line">
        <label for="enable">
            状态
        </label>
        <input id="enable" name="enable" type="text" class="easyui-switchbutton" data-options="onText:'启用',offText:'禁用'" th:checked="${permission?.enable==null||permission?.enable?true:false}"/>
    </div>
</form>
<script>
        $(function () {
            var tree=$("#parent",this);
            console.log(tree.html());
            console.log(tree.data("id")+"=====");
            tree.combotree({
                url: '/system/permission/getresouce',
                editable: false,
                value:tree.attr("value")
            });
        })




</script>
</body>
</html>